<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title><?php $headTitle = Kernel::getInstance()->getHeadTitle(); ?>
<?php if (empty($headTitle)): ?>
<?php echo $this->escape(Kernel::getInstance()->getSiteName()); ?>
<?php else: ?>
<?php echo $this->escape($headTitle); ?> | <?php echo $this->escape(Kernel::getInstance()->getSiteName()); ?>
<?php endif; ?></title>
  <link rel="stylesheet" type="text/css" media="screen" href="<?php echo ASSETS_URL_BASE .'/styles/global.css'; ?>" />
  <link rel="stylesheet" type="text/css" media="screen" href="<?php echo ASSETS_URL_BASE .'/styles/lime-green.css'; ?>" />
  <script type="text/javascript" src="<?php echo ASSETS_URL_BASE .'/scripts/jquery.js'; ?>"></script>
</head>
<body>

<div id="header">
  <div id="header-logo">
    <div id="sitename"><h1><a href="<?php echo site_url_base('/'); ?>"><?php echo $this->escape(Kernel::getInstance()->getSiteName()); ?></a></h1></div>
    <div id="sitetagline"><?php echo $this->escape(Kernel::getInstance()->getSiteTagline()); ?></div>
  </div>
  <div id="header-navbar">
    <ul id="global-nav">
      <li><a href="<?php echo site_url_base('/'); ?>">Main</a></li>
      <li><a href="<?php echo site_url_base('/users'); ?>">People</a></li>
      <li><a href="<?php echo site_url_base('/groups'); ?>">Groups</a></li>
    </ul>
    <ul id="main-nav">
<?php if (Account_Model_Session::hasValidSession() === FALSE): ?>
      <li><a href="<?php echo site_url_base('/login'); ?>">Login</a></li>
      <li><a href="<?php echo site_url_base('/account/register'); ?>">Register</a></li>
<?php else:
	//TODO: use helper or make this simple
	$sessAcc = Account_Model_Session::getAccount(); ?>
      <li><strong><a href="<?php echo site_url_base('/user/'. $sessAcc->getIdName()); ?>"><?php echo $this->escape($sessAcc->getNicename()); ?></a></strong></li>
      <li><a href="<?php echo site_url_base('/home'); ?>">Home</a></li>
      <!--li><a href="<?php echo site_url_base('/dashboard'); ?>">Dashboard</a></li-->
      <li><a href="<?php echo site_url_base('/logout'); ?>">Logout</a></li>
<?php endif; ?>
    </ul>

  </div>
</div>
<hr style="display:none" />

<?php if (count($this->flashMessages) > 0): ?>
<div id="flashbox">
  <ul>
<?php foreach ($this->flashMessages as $fmsg): ?>
    <li><?php echo $this->escape($fmsg); ?></li>
<?php endforeach; ?>
  </ul>
</div>
<?php endif; ?>


<div id="content">

<?php if ($this->singleWidgetPage === TRUE): ?>
<div class="widget">
  <div class="widget_title"><h3><?php echo $this->singleWidgetPageTitle; ?></h3></div>
  <div class="widget_content">
<?php endif; ?>


<?php echo $this->layout()->content ?>


<?php if ($this->singleWidgetPage === TRUE): ?>
  </div>
</div>
<?php endif; ?>

</div>


<div class="clear"></div>
<hr style="display:none" />
<div id="footer"><?php echo Kernel::getInstance()->getSiteFooterNotice(); ?></div>

</body>
</html>
